package com.trkj.pojos;

import java.io.Serializable;
import javax.persistence.*;
import java.util.List;


/**
 * The persistent class for the OFFICE_FUNCTION database table.
 * 
 */
@Entity
@Table(name="OFFICE_FUNCTION")
@NamedQuery(name="OfficeFunction.findAll", query="SELECT o FROM OfficeFunction o")
public class OfficeFunction implements Serializable {
	private static final long serialVersionUID = 1L;

	@Id
	@Column(name="OFFICE_FUNCTION_ID")
	private long officeFunctionId;

	@Column(name="FUNCTION_")
	private String function;

	private String name;

	//bi-directional many-to-one association to EmerArrange
	@OneToMany(mappedBy="officeFunction")
	private List<EmerArrange> emerArranges;

	//bi-directional many-to-one association to EquipUse
	@OneToMany(mappedBy="officeFunction")
	private List<EquipUse> equipUses;

	//bi-directional many-to-one association to LiveArrange
	@OneToMany(mappedBy="officeFunction")
	private List<LiveArrange> liveArranges;

	//bi-directional many-to-one association to Floor
	@ManyToOne
	@JoinColumn(name="FLOOR_ID")
	private Floor floor;

	//bi-directional many-to-one association to SmallOffice
	@ManyToOne
	@JoinColumn(name="SMALL_OFFICE_ID")
	private SmallOffice smallOffice;

	//bi-directional many-to-one association to PatientArrange
	@OneToMany(mappedBy="officeFunction")
	private List<PatientArrange> patientArranges;

	//bi-directional many-to-one association to Warehouse
	@OneToMany(mappedBy="officeFunction")
	private List<Warehouse> warehouses;

	public OfficeFunction() {
	}

	public long getOfficeFunctionId() {
		return this.officeFunctionId;
	}

	public void setOfficeFunctionId(long officeFunctionId) {
		this.officeFunctionId = officeFunctionId;
	}

	public String getFunction() {
		return this.function;
	}

	public void setFunction(String function) {
		this.function = function;
	}

	public String getName() {
		return this.name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public List<EmerArrange> getEmerArranges() {
		return this.emerArranges;
	}

	public void setEmerArranges(List<EmerArrange> emerArranges) {
		this.emerArranges = emerArranges;
	}

	public EmerArrange addEmerArrange(EmerArrange emerArrange) {
		getEmerArranges().add(emerArrange);
		emerArrange.setOfficeFunction(this);

		return emerArrange;
	}

	public EmerArrange removeEmerArrange(EmerArrange emerArrange) {
		getEmerArranges().remove(emerArrange);
		emerArrange.setOfficeFunction(null);

		return emerArrange;
	}

	public List<EquipUse> getEquipUses() {
		return this.equipUses;
	}

	public void setEquipUses(List<EquipUse> equipUses) {
		this.equipUses = equipUses;
	}

	public EquipUse addEquipUs(EquipUse equipUs) {
		getEquipUses().add(equipUs);
		equipUs.setOfficeFunction(this);

		return equipUs;
	}

	public EquipUse removeEquipUs(EquipUse equipUs) {
		getEquipUses().remove(equipUs);
		equipUs.setOfficeFunction(null);

		return equipUs;
	}

	public List<LiveArrange> getLiveArranges() {
		return this.liveArranges;
	}

	public void setLiveArranges(List<LiveArrange> liveArranges) {
		this.liveArranges = liveArranges;
	}

	public LiveArrange addLiveArrange(LiveArrange liveArrange) {
		getLiveArranges().add(liveArrange);
		liveArrange.setOfficeFunction(this);

		return liveArrange;
	}

	public LiveArrange removeLiveArrange(LiveArrange liveArrange) {
		getLiveArranges().remove(liveArrange);
		liveArrange.setOfficeFunction(null);

		return liveArrange;
	}

	public Floor getFloor() {
		return this.floor;
	}

	public void setFloor(Floor floor) {
		this.floor = floor;
	}

	public SmallOffice getSmallOffice() {
		return this.smallOffice;
	}

	public void setSmallOffice(SmallOffice smallOffice) {
		this.smallOffice = smallOffice;
	}

	public List<PatientArrange> getPatientArranges() {
		return this.patientArranges;
	}

	public void setPatientArranges(List<PatientArrange> patientArranges) {
		this.patientArranges = patientArranges;
	}

	public PatientArrange addPatientArrange(PatientArrange patientArrange) {
		getPatientArranges().add(patientArrange);
		patientArrange.setOfficeFunction(this);

		return patientArrange;
	}

	public PatientArrange removePatientArrange(PatientArrange patientArrange) {
		getPatientArranges().remove(patientArrange);
		patientArrange.setOfficeFunction(null);

		return patientArrange;
	}

	public List<Warehouse> getWarehouses() {
		return this.warehouses;
	}

	public void setWarehouses(List<Warehouse> warehouses) {
		this.warehouses = warehouses;
	}

	public Warehouse addWarehous(Warehouse warehous) {
		getWarehouses().add(warehous);
		warehous.setOfficeFunction(this);

		return warehous;
	}

	public Warehouse removeWarehous(Warehouse warehous) {
		getWarehouses().remove(warehous);
		warehous.setOfficeFunction(null);

		return warehous;
	}

}